<?php if (!defined("MAIN_DIR")) { header("Location: /"); die; }

if ($route->POST('login') != '' && $route->POST('password') != '') {

	$remember = $route->POST("remember") != "";
	$auth = $user->login($route->POST('login'),$route->POST('password'),$remember);
	if (!$auth){
		goToPage("/admin?error=login");
	} else {
		goToPage($_SERVER["HTTP_REFERER"]);
	}
}
?>